<template>
  <div class="teacher-container">
          <layout :isCollapse="isCollapse" class="layout"></layout>
        <contented :isCollapse="isCollapse" :class="!isCollapse?'contented':'active'" @changefold="changefold_fat"></contented>
  </div>
</template>

<script>
import layout from '@/views/Teacher/Layout/index';
import contented from '@/views/Teacher/Content/index'
export default {
  name: '',
  data () {
    return {
      isCollapse: false,
    }
  },
  methods: {
      changefold_fat(){
          this.isCollapse=!this.isCollapse;
      }
  },
  mounted () {
          //防止恶意跳转网页
    if (localStorage.getItem("path")) {
      if (localStorage.getItem("path")=="/teacher") {
      } else {
        this.$router.push("/login");
      }
    } else {
      this.$router.push("/login");
    }
  },
  components: {
    layout,contented
  }
}
</script>

<style lang="less" scoped>
.teacher-container {
    display: flex;
    .layout {
        background-color: #545c64;
        position: fixed;
        top:0;
        bottom:0;
    }
    .contented{
        flex: 1;
        margin-left: 200px;
    }
    .active {
        flex: 1;
        margin-left: 64px;
    }
}
.move-leave-active {
    transition: all 2s linear;
}
</style>
